﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web_Oto.Business;

namespace Web_Oto
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                GetSeoInformations();
                GetIntroduction(); 
            }
        }

        private void GetIntroduction()
        {
            var introductionBus = new IntroductionBus();
            var query = introductionBus.GetIntroduction();
            if(query != null)
                ltrIntroduction.Text = query.Description;
        }

        private void GetSeoInformations()
        {
            var seoBus = new SeoBus();
            var seo = seoBus.GetSeoPage("homepage");
            if (seo != null)
            {
                Page.Title = seo.Title;
                Page.MetaDescription = seo.Description;
                Page.MetaKeywords = seo.Keyword;
            }
        }
    }
}